package com.travel.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("login")
public class LoginContoller {
	
	/**
	 * 验证码异步验证
	 * @param session
	 * @return
	 */
	@RequestMapping("login.do")
	@ResponseBody
	public String vificationCode( HttpSession session){
		String str="";
		String code=(String)session.getAttribute("rand");
		System.out.println("验证码是："+code);
		return code;
	}
	/**
	 * 返回的验证码显示
	 * @return
	 */
	@RequestMapping("image.jpg")
	public String image(){
		return "jsp/image";
	}
	
	
	
}
